home *** CD-ROM | disk | FTP | other *** search
- #include <fcntl.h>
- #include <stdarg.h>
- #include <sys/types.h>
-
- void kprintf(char *, ...);
-
- extern int debug;
-
- int fcntl(int fd, int cmd, ...)
- {
- int arg;
- va_list args;
- va_start(args, cmd);
- arg = va_arg(args, int);
- mysleep(1);
- switch(cmd)
- {
- case F_DUPFD : return dup2(fd, next_fd(arg)); break;
- case F_SETFD : if (debug) kprintf("Set fd flags\n"); return 0;
- case F_GETFL : if (debug) kprintf("Get file status flags\n"); return O_RDWR; /* dummy */
- case F_SETFL : if (debug) kprintf("Set file status flags\n"); return 0;
- default: kprintf("Unsupported fcntl cmd %d\n", cmd);
- }
- return -1;
- }
-
-